Base62 Util
Functions
- encode encodes a string(str, prefix)
- decode decodes an encoded string(str, prefix)
- v4 creates a random UUID()
- v1 create a random UUID()
- encode encodes the input with the provided encode method(input, encoding)
- decode decodes the encoded data with the encoding method(b62Str, encoding)
- ensureLength adds or removes 0s to the string to ensure the length(str, maxLen)
- padLeft adds 0s to the beginning of the string()
- trimLeft removes 0s from the beginning of the string()
encode encodes a string(str, prefix)
Kind: global function
Param | Type | Description |
---|---|---|
str | string | the string to be encoded |
prefix | string | a prefix to be added to the encoded string |
decode decodes an encoded string(str, prefix)
Kind: global function
Param | Type | Description |
---|---|---|
str | string | the string to be decoded |
prefix | string | prefix to be taken off the str before it is decoded |
v4 creates a random UUID()
v1 create a random UUID()
encode encodes the input with the provided encode method(input, encoding)
Kind: global function
Param | Description |
---|---|
input | the input to be encoded |
encoding | the method to encode the input with |
decode decodes the encoded data with the encoding method(b62Str, encoding)
Kind: global function
Param | Description |
---|---|
b62Str | encoded data to be decoded |
encoding | the method to encode the input with |
ensureLength adds or removes 0s to the string to ensure the length(str, maxLen)
Kind: global function
Api: private
Param | Type | Description |
---|---|---|
str | string | the string to be manipulated |
maxLen | number | the length to force the string to |
padLeft adds 0s to the beginning of the string()
Kind: global function
Api: private
trimLeft removes 0s from the beginning of the string()
Kind: global function
Api: private