diff options
author | Christian Hesse <mail@eworm.de> | 2018-10-09 14:12:38 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2018-10-09 14:17:19 +0200 |
commit | 977a5d5f5e021ecdcf22bacb831c5e4042a5c9e5 (patch) | |
tree | 0242e9c47bc8022b827c0e05df04e5cb50d9e2e1 /global-functions | |
parent | 7b4bef1a1e8e110b6fc30f7b2768e04b8b153693 (diff) |
global-functions: move daily psk secrets to global-config
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/global-functions b/global-functions index 5af2999..e60d28d 100644 --- a/global-functions +++ b/global-functions @@ -8,20 +8,7 @@ :global GeneratePSK do={ :local date $1; - # 0-30 for days of month - :local secret1 { "Abusive"; "Aggressive"; "Bored"; "Chemical"; "Cold"; - "Cruel"; "Curved"; "Delightful"; "Discreet"; "Elite"; "Evasive"; "Faded"; - "Flat"; "Future"; "Grandiose"; "Hanging"; "Humorous"; "Interesting"; - "Magenta"; "Magnificent"; "Numerous"; "Optimal"; "Pathetic"; "Possessive"; - "Remarkable"; "Rightful"; "Ruthless"; "Stale"; "Unusual"; "Useless"; - "Various" } - # 0-11 for month of year - :local secret2 { "Adhesive"; "Amusing"; "Astonishing"; "Frantic"; - "Kindhearted"; "Limping"; "Roasted"; "Robust"; "Staking"; "Thundering"; - "Ultra"; "Unusual" } - # 0-6 for days of week - :local secret3 { "Belief"; "Button"; "Curtain"; "Edge"; "Jewel"; "String"; - "Whistle" } + :global "daily-psk-secrets"; :local months { "jan"; "feb"; "mar"; "apr"; "may"; "jun"; @@ -52,7 +39,9 @@ :set sum ($sum + $month); :set sum ($sum - (($sum / 7) * 7)); - :local return ([ :pick $secret1 ($day - 1) ] . [ :pick $secret2 $month ] . [ :pick $secret3 $sum ]); + :local return ([ :pick [ :pick $"daily-psk-secrets" 0 ] ($day - 1) ] . \ + [ :pick [ :pick $"daily-psk-secrets" 1 ] $month ] . \ + [ :pick [ :pick $"daily-psk-secrets" 2 ] $sum ]); :return $return; } |