diff --git a/lang/base38/base38.go b/lang/base38/base38.go new file mode 100644 index 00000000..69013318 --- /dev/null +++ b/lang/base38/base38.go @@ -0,0 +1,79 @@ +// Use of this source code is governed by a BSD-style license that can be found +// in the LICENSE file. + +// Package base38 converts a 4-byte string, each byte in [ 0-9?a-z], to a base +// 38 number. +package base38 + +const ( + // Max is the inclusive upper bound for the value returned by Encode. Its + // value equals (38*38*38*38 - 1). + Max = 2085135 + // MaxBits is the number of bits required to represent Max. It satisfies + // (1<<(MaxBits-1) <= Max) && (Max < 1< Max || got > 1<