kopia lustrzana https://github.com/c9/core
26 wiersze
731 B
JavaScript
26 wiersze
731 B
JavaScript
![]() |
"use strict";
|
||
|
|
||
|
"use server";
|
||
|
|
||
|
var assert = require("assert");
|
||
|
var crypt = require("./crypt");
|
||
|
|
||
|
module.exports = {
|
||
|
|
||
|
name: "cookie crypt",
|
||
|
|
||
|
"test encrpyt and decrypt should return input" : function() {
|
||
|
var sessionId = "vOcRVvhaBBauiYexVvWyJpPb.AqmabaXkhpmlR8AUkORJHu%2FB7WA57EsDqzled0VoKAg";
|
||
|
var secret = "geheim";
|
||
|
|
||
|
assert.equal(crypt.crypt(sessionId, secret), "C+kRJ4UWhmjgqo7DVv31cJLfZ9LIPLZB7OuMdN8i07ZdZHKlusCClMKaqBEwHDiKH3uFKf8IUZOxoVHU6+eNrkLArr32HrBDLr8qfnKfAgY");
|
||
|
|
||
|
assert.equal(
|
||
|
crypt.decrypt(crypt.crypt(sessionId, secret), secret),
|
||
|
sessionId
|
||
|
);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
!module.parent && require("asyncjs").test.testcase(module.exports).exec();
|