Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
import std.algorithm, std.array, std.string; ubyte[] encrypt(const(char)[] s) pure { //Do something much more secure here return (cast(const(ubyte)[])s).map!(x => cast(ubyte)(x + 1)).array; } char[] decrypt(const(ubyte)[] s) pure { //Ditto return cast(char[])(s.map!(x => cast(ubyte)(x - 1)).array); } enum immutable(ubyte)[] MySecretData = encrypt("I love Sailor Moon"); import std.stdio; void main() { writeln(MySecretData.decrypt); writeln(cast(string) MySecretData); }
Result:
Success
/
Return code: 0
Application output:
I love Sailor Moon J!mpwf!Tbjmps!Nppo
Paste info
Author:
Guest
Views:
487
Private:
no
Expires:
Never
Uploaded:
07.01.15 16:02
Parent:
#3bbdecfefa5c
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.079.1 ( 2.079.1 )
Pointer size:
m64
Actions
Download
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason