Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
jio_mebibou
Commits
ed223188
Commit
ed223188
authored
Nov 23, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding revision generator to localstorage.js
parent
345b57d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
src/jio.storage/localstorage.js
src/jio.storage/localstorage.js
+23
-0
No files found.
src/jio.storage/localstorage.js
View file @
ed223188
...
...
@@ -22,6 +22,29 @@ var newLocalStorage = function ( spec, my ) {
}
};
/**
* Generates a hash code of a string
* @method hashCode
* @param {string} string The string to hash
* @return {string} The string hash code
*/
priv
.
hashCode
=
function
(
string
)
{
return
hex_sha256
(
string
);
};
/**
* Generates the next revision of [previous_revision]. [string] helps us
* to generate a hash code.
* @methode generateNextRev
* @param {string} previous_revision The previous revision
* @param {string} string String to help generate hash code
* @return {string} The next revision
*/
priv
.
generateNextRev
=
function
(
previous_revision
,
string
)
{
return
(
parseInt
(
previous_revision
.
split
(
'
-
'
)[
0
],
10
)
+
1
)
+
'
-
'
+
priv
.
hashCode
(
previous_revision
+
string
);
};
/**
* Replace substrings to others substring following a [list_of_replacement].
* It will be executed recusively to replace substrings which are not
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment