HomeDevCentral

[core] url::encode, url::decode, guidmd5, dg now returns "" if key doesn't exist
03261d5749afUnpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

[core] url::encode, url::decode, guidmd5, dg now returns "" if key doesn't exist

guidmd5 <string to hash>

Computes a MD5 hash, outputs it as a GUID

15:19:42 <Dereckson> .tcl md5 ""
15:19:42 <nasqueron> Tcl: d41d8cd98f00b204e9800998ecf8427e
15:19:43 <Dereckson> .tcl guidmd5 ""
15:19:43 <nasqueron> Tcl: d41d8cd9-8f00-b204-e980-0998ecf8427e

url::encode <URL to encode>
url::decode <URL to decode>

Encodes and decodes an URL

15:21:50 <Dereckson> .tcl url::encode "mail: alpha@gamma"
15:21:50 <nasqueron> Tcl: mail%3a+alpha%40gamma
15:22:09 <Dereckson> .tcl url::decode "mail%3a+alpha%40gamma"
15:22:09 <nasqueron> Tcl: mail: alpha@gamma

dg <dict> <key> [throwErrorIfKeyDoesNotExist]

dg $dict $keyNotExistant now returns ""

This allows to avoid to check dict exists before call dg.

If an error should be thrown, define throwErrorIfKeyDoesNotExist at true:

15:24:01 <Dereckson> .tcl dg "foo bar" quux
15:24:02 <nasqueron> Tcl:
15:24:03 <Dereckson> .tcl dg "foo bar" quux 1
15:24:04 <nasqueron> Tcl error: Key not found: quux

Details

Provenance
derecksonAuthored on Jan 18 2013, 14:25
Parents
rVIPERa679b731761c: .mail command (from SurfBoard source code)
Branches
Unknown
Tags
Unknown