var crypto = require('../../lib/common/Crypto.js');

describe('Crypto', function () {
    it('should convert hex to base64 for md5', function () {
        var md5 = crypto.md5('test');
        var base64 = crypto.md5('test', 'base64');
        expect(base64).toEqual(crypto.convertHexToBase64(md5));
    });

    it('should convert hex to base64 for sha1', function () {
        var hex = crypto.sha1('test');
        var base64 = crypto.sha1('test', 'base64');
        expect(base64).toEqual(crypto.convertHexToBase64(hex));
    });

    it('should convert hex to base64 for sha256', function () {
        var hex = crypto.sha256('test');
        var base64 = crypto.sha256('test', 'base64');
        expect(base64).toEqual(crypto.convertHexToBase64(hex));
    });
});
