2020-03-25 17:03:40 +01:00

29 lines
646 B
JavaScript

/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Encoding-Helper which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
// @ts-nocheck
'use strict';
const test = require ('ava');
const encoding = require ('../index');
test ('encoding to_hex', (t) => {
const hex = encoding.to_hex ('foo');
t.is (hex, '666f6f');
});
test ('encoding to_b64', (t) => {
const hex = encoding.to_b64 ('foo');
t.is (hex, 'Zm9v');
});
test ('encoding to_utf8', (t) => {
const utf = encoding.to_utf8 ('Zm9v', 'base64');
t.is (utf, 'foo');
});