Skip to content

NumberEncoder/NumberDecoder with API similar to TextEncoder/TextDecoder

Notifications You must be signed in to change notification settings

perceptron8/number-encoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

number-encoding

NumberEncoder/NumberDecoder with API similar to TextEncoder/TextDecoder.

Usage

encoding:

const number = ...;
const encoder = new NumberEncoder("Uint32");
const bytes = encoder.encode(number);

decoding:

const bytes = ...;
const decoder = new NumberDecoder("Uint32");
const number = decoder.decode(bytes);

supported "types":

  • "Int8", "Int16", "Int32"
  • "Uint8", "Uint16", "Uint32"
  • "Float32", "Float64"

See also

About

NumberEncoder/NumberDecoder with API similar to TextEncoder/TextDecoder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published