summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2009-11-19 13:57:12 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2009-11-19 13:57:12 +0000
commitd0de561afb1cf7289435e529c006cf318071fa35 (patch)
treeebc8a347eadae68f85eaee52afd9c1bd52ed9e17
parente5d8a3cdb428b93f23056342f47cdde240742f69 (diff)
Fix random cookie creation
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@414 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rw-r--r--publish6
1 files changed, 1 insertions, 5 deletions
diff --git a/publish b/publish
index 05aed4c..2dccb18 100644
--- a/publish
+++ b/publish
@@ -48,12 +48,8 @@ uri_encode() {
perl -MURI::Escape -ne 'print uri_escape($_)'
}
-base64_encode() {
- perl -MMIME::Base64 -ne 'print encode_base64($_,'')'
-}
-
get_random() {
- head -c 128 /dev/urandom | base64_encode | sed -e 's/[^a-zA-Z0-9]//g' | head -c 16
+ head -c 8 /dev/urandom | base64 | tr '/+' '-_' | tr -d '='
}
TEST=false