diff options
| author | Omar Rizwan <omar@omar.website> | 2023-07-10 20:30:32 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-10 20:30:32 +0000 |
| commit | 467ad97d3533d30ffc7addcfbb8683d8b05ea677 (patch) | |
| tree | 571b832d03bc7a518df72e42804372c15f8fa892 | |
| parent | Merge pull request #43 from FolkComputer/osnr/libdrm-rendering (diff) | |
| parent | Better privacy for wifi in hosts.tcl (diff) | |
| download | folk-467ad97d3533d30ffc7addcfbb8683d8b05ea677.tar.gz folk-467ad97d3533d30ffc7addcfbb8683d8b05ea677.zip | |
Merge pull request #45 from FolkComputer/wifi-hashing
Better privacy for wifi in hosts.tcl
| -rw-r--r-- | hosts.tcl | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,13 @@ +# TODO: Find a good C sha-smth instead of this. +proc hashString {str} { + set hash 0 + foreach char [split $str ""] { + set ascii [scan $char %c] + set hash [expr {($hash * 31 + $ascii) & 0xffffffff}] + } + set hash +} + if {[info exists ::env(FOLK_SHARE_NODE)]} { set ::shareNode $::env(FOLK_SHARE_NODE) } else { @@ -20,6 +30,8 @@ if {[info exists ::env(FOLK_SHARE_NODE)]} { set ::shareNode "folk0.local" } elseif {[string match "_onefact.org*" $wifi]} { set ::shareNode "folk-onefact.local" + } elseif {[hashString $wifi] eq 4077950650 || [hashString $wifi] eq 862457117} { + set ::shareNode "folk-arc.local" } else { # there's no default. } |
