Git Product home page Git Product logo

base85's Introduction

Base85

Build Status

Base85 is a C library to convert from plain to base 85 and vice versa suitable for embedded systems. It uses the character set of the Base85 RFC 1924.

API

To convert from plain to base 85 the following function is used:

char* bintob85( char* dest, void const* src, size_t size );
  • The parameter 'src' is the source memory block to be converted.
  • The parameter 'size' is the size in bytes of the source memory block.
  • The parameter 'dest' is the destination buffer where the translation to base 85 is stored. Also a null character is added at the end to become a null-terminated string.
  • The return value is a pointer to the null character.

To convert from base 85 to plain the following function is used:

void* b85tobin( void* dest, char const* src );
  • The parameter 'src' is the source base 85 string. It must be terminated in a non base 85 digit. A null-terminated string is OK.
  • The parameter 'dest' is the destination memory block where the result of convertion is stroed.
  • The return value is a null pointer if the base 85 string has bad format. If the convertion is successfully the return value is a pointer to the end of the convertion. With this pointer you can get the length of the result.

Convert from base 85 to plain in the same memory block is possible using the previous function by setting the same pointer for the destination and source. Or just use the following wrapper function:

static inline void* b85decode( void* p ) {
    return b85tobin( p, (char*)p );
}

base85's People

Contributors

rafagafe avatar

Watchers

 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.