mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
Add RFC4648-compliant base64 encoding and decoding routines, based on the base64url encoding in fs/crypto/fname.c. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Cc: Eric Biggers <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
17 lines
370 B
C
17 lines
370 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* base64 encoding, lifted from fs/crypto/fname.c.
|
|
*/
|
|
|
|
#ifndef _LINUX_BASE64_H
|
|
#define _LINUX_BASE64_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#define BASE64_CHARS(nbytes) DIV_ROUND_UP((nbytes) * 4, 3)
|
|
|
|
int base64_encode(const u8 *src, int len, char *dst);
|
|
int base64_decode(const char *src, int len, u8 *dst);
|
|
|
|
#endif /* _LINUX_BASE64_H */
|