Skip to content

Commit

Permalink
Missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Dec 8, 2016
1 parent ba3ff33 commit e450bbb
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions include/scalarbase64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef SCALAR_B64
#define SCALAR_B64

/**
* Assumes recent x64 hardware with AVX2 instructions.
*/

#include <stddef.h>
#include <stdint.h>


/**
* We copy the code below from https://github.com/aklomp/base64
**/


/* Wrapper function to decode a plain string of given length. Output is written
* to *out without trailing zero. Output length in bytes is written to *outlen.
* The buffer in `out` has been allocated by the caller and is at least 3/4 the
* size of the input. */
int scalar_base64_decode
( const char *src
, size_t srclen
, char *out
, size_t *outlen
) ;


/* Wrapper function to encode a plain string of given length. Output is written
* to *out without trailing zero. Output length in bytes is written to *outlen.
* The buffer in `out` has been allocated by the caller and is at least 4/3 the
* size of the input. */
void scalar_base64_encode
( const char *src
, size_t srclen
, char *out
, size_t *outlen
) ;


#endif

0 comments on commit e450bbb

Please sign in to comment.