GithubHelp home page GithubHelp logo

isabella232 / basexx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luadist/basexx

0.0 0.0 0.0 128 KB

A Lua library which provides base2(bitfield), base16(hex), base32(crockford/rfc), base64 decoding and encoding.

License: MIT License

basexx's Introduction

#basexx

A Lua library which provides base2(bitfield), base16(hex), base32(crockford/rfc), base64 decoding and encoding.

##from_bit / to_bit

Converts a byte string to a bitfield string.

  • 0, O and o maps to the same value
  • 1, I, i, L and l maps to the same value
basexx.to_bit( "ACDC" ) --> 01000001010000110100010001000011
basexx.from_bit( "01000001010000110100010001000011" ) --> ACDC
basexx.from_bit( "o1ooooo1o1oooo11" ) --> AC
basexx.from_bit( "OioooooiOiooooii" ) --> AC

##from_hex / to_hex

Converts a byte string to a uppercase hex data string.

basexx.to_hex( "Hello world!" ) --> 48656C6C6F20776F726C6421
basexx.from_hex( "48656C6C6F20776F726C6421" ) --> Hello world!
basexx.from_hex( "48656c6c6f20776f726c6421" ) --> Hello world!

##from_base32 / to_base32

Converts a byte string to a base32(rfc3548) uppercase data string.

  • It's case insensitive
basexx.to_base32( "chunky bacon!" ) --> MNUHK3TLPEQGEYLDN5XCC===
basexx.from_base32( "MNUHK3TLPEQGEYLDN5XCC===" ) --> chunky bacon!

##from_crockford / to_crockford

Converts a byte string to a base32(crockford) uppercase data string. The optional check value is not implemented.

  • It's case insensitive
  • 1, I, i, L and l maps to the same value
  • 0, O and o maps to the same value
  • U, u, V and v maps to the same value (not part of the official description)
string.lower( basexx.to_crockford( "Hello World" ) ) --> 91jprv3f41bpywkccg
basexx.from_crockford( "axqqeb10d5u20wk5c5p6ry90exqq4uvk44" ) --> Wow, it really works!

##from_base64 / to_base64

Converts a byte string to a base64 data string.

basexx.to_base64( "Man") --> TWFu
basexx.from_base64( "TWFu" ) --> Man

basexx's People

Contributors

aiq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.