fix: add scrambling to user names and projectIds

This commit is contained in:
Christoph Kluge
2023-07-17 15:45:40 +02:00
parent 56f66aa706
commit eed8bb2d44
2 changed files with 10 additions and 7 deletions

View File

@@ -7,7 +7,10 @@
-->
<script context="module">
export const scrambleNames = window.localStorage.getItem("cc-scramble-names")
export const scramble = (str) => [...str].reduce((x, c, i) => x * 7 + c.charCodeAt(0) * i * 21, 5).toString(32)
export const scramble = function(str) {
if (str === '-') return str
else return [...str].reduce((x, c, i) => x * 7 + c.charCodeAt(0) * i * 21, 5).toString(32).substr(0, 6)
}
</script>
<script>
import Tag from '../Tag.svelte';