Commit 2985d31d authored by Tristan Cavelier's avatar Tristan Cavelier

update some files to use the good amd hash library

parent 7c3c4818
......@@ -16,8 +16,8 @@
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
module(jIO, hex_sha256);
}(['jio', 'sha256'], function (jIO, hex_sha256) {
module(jIO, {hex_sha256: hex_sha256});
}(['jio', 'sha256'], function (jIO, sha256) {
"use strict";
jIO.addStorageType("revision", function (spec, my) {
......@@ -88,7 +88,7 @@
* @return {string} The string hash code
*/
priv.hashCode = function (string) {
return hex_sha256(string);
return sha256.hex_sha256(string);
};
/**
......
......@@ -10,11 +10,11 @@
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
window.jIO = module(hex_md5);
}(['md5'], function (hex_md5) {
window.jIO = module({hex_md5: hex_md5});
}(['md5'], function (md5) {
"use strict";
var localstorage;
var localstorage, hex_md5 = md5.hex_md5;
if (typeof localStorage !== "undefined") {
localstorage = {
getItem: function (item) {
......
......@@ -8,7 +8,7 @@
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
module(jIO, jio_tests, hex_sha256);
module(jIO, jio_tests, {hex_sha256: hex_sha256});
}([
'jio',
'jio_tests',
......@@ -16,7 +16,7 @@
'localstorage',
'revisionstorage',
'replicaterevisionstorage'
], function (jIO, util, hex_sha256) {
], function (jIO, util, sha256) {
"use strict";
//////////////////////////////////////////////////////////////////////////////
......@@ -66,7 +66,7 @@
delete doc._revs_info;
string = JSON.stringify(doc) + JSON.stringify(revisions) +
JSON.stringify(deleted_flag ? true : false);
return hex_sha256(string);
return sha256.hex_sha256(string);
}
//////////////////////////////////////////////////////////////////////////////
......
......@@ -8,11 +8,11 @@
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
module(jIO, jio_tests, hex_sha256);
module(jIO, jio_tests, {hex_sha256: hex_sha256});
}(['jio', 'jio_tests', 'sha256', 'localstorage', 'revisionstorage'], function (
jIO,
util,
hex_sha256
sha256
) {
"use strict";
......@@ -63,7 +63,7 @@
delete doc._revs_info;
string = JSON.stringify(doc) + JSON.stringify(revisions) +
JSON.stringify(deleted_flag ? true : false);
return hex_sha256(string);
return sha256.hex_sha256(string);
}
//////////////////////////////////////////////////////////////////////////////
......
......@@ -6,8 +6,9 @@
require.config({
"paths": {
"md5": "../lib/md5/md5",
"sha256": "../lib/jsSha2/sha256",
"md5": "../lib/md5/md5.amd",
"sha1": "../lib/jsSha1/sha1.amd",
"sha256": "../lib/jsSha2/sha256.amd",
"jquery": "../lib/jquery/jquery.min",
"complex_queries": "../complex_queries",
"complex_queries_tests": "queries/tests",
......@@ -36,8 +37,6 @@
"sinon_qunit": "../lib/sinon/sinon-qunit"
},
"shim": {
"md5": {"exports": "hex_md5"},
"sha256": {"exports": "hex_sha256"},
"jquery": {"exports": "jQuery"},
"sinon": ["qunit"],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment