urlsafer
v0.1.1
Published
A JavaScript library for handling URL-safe Base64 encoding and decoding, offering full compatibility with modern standards and enhanced security
Downloads
46
Maintainers
Readme
urlsafer
A JavaScript library for handling URL-safe Base64 encoding and decoding, offering full compatibility with modern standards and enhanced security.
Installation
Using npm:
npm install urlsafer
Using yarn:
yarn add urlsafer
Usage Example
const UrlSafer = require('urlsafer');
// Encoding
const encoded = UrlSafer.encode('Hello World');
console.log(encoded); // Outputs URL-safe Base64 encoded string
// Decoding
const decoded = UrlSafer.decode(encoded);
console.log(decoded); // Outputs the original string 'Hello World'
API
encode(rawString)
Encodes the given string into a URL-safe Base64 string.
decode(encodedString)
Decodes a URL-safe Base64 string back to the original string.