0.1.0 • Published 5 months ago
@hugov/shorter-string2 v0.1.0
shorter-string
small string to string compression for short strings to any base with a given character set
Example
import {encode, decode} from './index.js'
const code = encode('text to encode')
API
exports | Note |
---|---|
string constants | |
BASE62 | 0-9A-Za-z |
BASE64 | BASE62 + -_ |
UNRESERVED | BASE62 + -._~ ; RFC 3986 base:66 |
PCHAR | UNRESERVED + %!$&'()*+,;=:@ ; RFC 3986 base:80 |
QUERY | PCHAR without ' for chrome base:79 |
RFC1924 | RFC1924 base:85 |
HASH | PCHAR + /?# ; base:81 |
functions | |
encode | ( text:string, [keys:string=HASH] ) => code:string |
decode: | ( code:string, [keys:string=HASH] ) => text:string |
License
0.1.0
5 months ago