From 1d4058bed129fd32e15e6388deb235b5648dadba Mon Sep 17 00:00:00 2001 From: hophacker Date: Fri, 8 Jan 2021 09:44:16 +0800 Subject: [PATCH] random hex --- zsh/functions.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index c774045..ec62188 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -317,3 +317,7 @@ function gc { function gcm { (gc --message $*) || return } + +function random_hex { + openssl rand -hex $(expr $1 / 2) +}