Coder Social home page Coder Social logo

calzakk / cyoencode Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 3.0 54 KB

Provides C functions for encoding binary data into a printable representation using Base64, Base32, Base16 (hex), or Base85/Ascii85 character sets, plus equivalent functions for the decoding of such encoded data back into its binary form.

License: Other

C 81.11% C++ 18.66% Shell 0.06% QMake 0.18%

cyoencode's People

Contributors

calzakk avatar nthuemmel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cyoencode's Issues

base85 encode/decode doesn't work

As per this code:

#include <stdio.h>

#include "CyoEncode.h"
#include "CyoDecode.h"


int main(int argc, char ** argv)
{
	const char instr[] = "Hello, world!";
	char * b85 = (char*) malloc(cyoBase85EncodeGetLength(sizeof(instr))+1);
	size_t b85_len = cyoBase85EncodeA(b85, instr, sizeof(instr));

	printf("Encoded b85 [%.*s]\n", (int) b85_len, b85);

	char *decoded = (char *) malloc(cyoBase85DecodeGetLength(b85_len) + 1);
	size_t decoded_len = cyoBase85DecodeA(decoded, b85, b85_len);
	printf("Decoded b85 [%.*s]\n", (int) decoded_len, decoded);
	return 0;
}

The 'decoded_len' is 0.

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.