1.0.0 • Published 5 years ago

ts-base-64 v1.0.0

Weekly downloads
40
License
ISC
Repository
github
Last release
5 years ago

TsBase64 Encode & Decode

Simply download or copy/paste this class into your project

//Methods
public static ToBase64(strObj: string|object|number): string
public static FromBase64(str:string):string
public static EncodeURI(str:string):string

//Usage
let toB64: string = TsBase64.Encode("Typescript"); // Non-URI encoded, Base64 string.
let fromB64: string = TsBase64.Decode("VHlwZXNjcmlwdA=="); // Typescript
let uriEncodedB64: string = TsBase64.EncodeURI("Typescript\""); // "VHlwZXNjcmlwdA" (Removes the '==' chars)

// Non-URI encoded, Base64 string.
console.log(toB64); // VHlwZXNjcmlwdA==
console.log(fromB64); // Typescript.

//Removes the special characters ('==').
console.log(uriEncodedB64); // VHlwZXNjcmlwdA==