aboutsummaryrefslogtreecommitdiff
path: root/app/utils
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2021-03-09 22:43:12 +0100
committerRuben Beltran del Rio <ruben@unlimited.pizza>2021-03-09 22:43:12 +0100
commitbd8e98d7e24c4dbaee7db6ec7955f7c2f6d396a6 (patch)
treee5f0dcbc14d3009c17e5f562404fe19f6aceab73 /app/utils
parent862a5f9cdbbda522c608ea63c1e296e81f44de10 (diff)
Update to SvelteKit
Diffstat (limited to 'app/utils')
-rw-r--r--app/utils/glyph_hash.js38
1 files changed, 0 insertions, 38 deletions
diff --git a/app/utils/glyph_hash.js b/app/utils/glyph_hash.js
deleted file mode 100644
index 120c02a..0000000
--- a/app/utils/glyph_hash.js
+++ /dev/null
@@ -1,38 +0,0 @@
-const internals = {
- kSplitterRegex: /.{1,8}/g,
- kGlyphs: [
- '☽',
- '☆',
- '♢',
- '♡',
- '╱',
- '╲',
- '╳',
- '〰',
- '▷',
- '⏊',
- '〒',
- '▢',
- '◯',
- '⏃',
- '⏀',
- '⏆'
- ]
-};
-
-// Return a glyph with color based on a 4 byte fragment of a UUIDv4
-const getGlyphHashFragment = function (uuidFragment) {
-
- const glyphIndex = parseInt(uuidFragment.substring(0,2), 16) % 16;
- return {
- glyph: internals.kGlyphs[glyphIndex],
- color: `#${uuidFragment.substring(2,8)}`
- };
-};
-
-// Return an array of glyphs based on a UUIDv4
-export const getGlyphHash = function (uuid) {
-
- const hashFragments = uuid.match(internals.kSplitterRegex);
- return hashFragments.map(getGlyphHashFragment);
-};