Here is the online GUID generator which offer 16-symbols-long GUID: http://www.shortguid.com. They say that their Short GUID-128 is a 128-bit GUID represented as Base64 string. Short GUID Example: Z6y83ED2i0_mJ7i-. I've tried to implement base64 encoding for GUID and the best result I got is 22 (same result listed in a great article http://blog.codinghorror.com/equipping-our-ascii-armor/). Does anybody have an idea how they(http://www.shortguid.com) generate such short GUID (I mean 16 base64 symbols is 12bytes and they are missing 4 byte of uniqueness of standart 16byte GUID :) )?
I would write this as a comment, but I don't have enough reputation points to do so.
There was a bug in the code. It's fixed. Thanks for pointing it out. I will put a thank you note on the site, if you don't mind :)
Related
everyone,
I am not so familiar with coding but I have been looking for hours now without answer. Maybe because I do not know what am I looking for.
I have found an LUA code with the below encoded code,
I was wondering which kind of encoding it is? Is there a specific name for it, is there a way to decrypt it? for the curious one, it looks like :
return(function(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_llIIlIIllllIl)local aaEE_IIllllIIlIIllIlIIII=string.char;local aaEE_lIlllIlIllIIIlIlIl=string.sub;local aaEE_IlIlIIIllIlIIIllllIIIIIIl=table.concat;local aaEE_IIIIIIlllIIIIllllIlIII=math.ldexp;local aaEE_IIIlIIllIIllIIlIIllIllII=getfenv or function()return _ENV end;local aaEE_lIllIIIIIllllIlIlIl=select;local aaEE_lIlIlllIllIIII=unpack or table.unpack;local aaEE_llllIlllllIlIlIl=tonumber;local function aaEE_lllIllIIIlIIlllIIll(aaEE_IIlIllIlII)local aaEE_llllIIllllIll,aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_lIlIlllIllIIII="","",{}local aaEE_IlIllIlllIIlIllllIll=256;local aaEE_IIllIllIIIlIIlllIIlIII={}for aaEE_lIlIIIIIlI=0,aaEE_IlIllIlllIIlIllllIll-1 do aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]=aaEE_IIllllIIlIIllIlIIII(aaEE_lIlIIIIIlI)end;local aaEE_lIlIIIIIlI=1;local function aaEE_IlIlllllllIIlI()local aaEE_llllIIllllIll=aaEE_llllIlllllIlIlIl(aaEE_lIlllIlIllIIIlIlIl(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_lIlIIIIIlI),36)aaEE_lIlIIIIIlI=aaEE_lIlIIIIIlI+1;local aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_llllIlllllIlIlIl(aaEE_lIlllIlIllIIIlIlIl(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_lIlIIIIIlI+aaEE_llllIIllllIll-1),36)aaEE_lIlIIIIIlI=aaEE_lIlIIIIIlI+aaEE_llllIIllllIll;return aaEE_lIIlIlllIlllIIIllIIlIllI end;aaEE_llllIIllllIll=aaEE_IIllllIIlIIllIlIIII(aaEE_IlIlllllllIIlI())aaEE_lIlIlllIllIIII[1]=aaEE_llllIIllllIll;while aaEE_lIlIIIIIlI<#aaEE_IIlIllIlII do local aaEE_lIlIIIIIlI=aaEE_IlIlllllllIIlI()if aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]then aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]else aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_llllIIllllIll..aaEE_lIlllIlIllIIIlIlIl(aaEE_llllIIllllIll,1,1)end;aaEE_IIllIllIIIlIIlllIIlIII[aaEE_IlIllIlllIIlIllllIll]=aaEE_llllIIllllIll..aaEE_lIlllIlIllIIIlIlIl(aaEE_lIIlIlllIlllIIIllIIlIllI,1,1)aaEE_lIlIlllIllIIII[#aaEE_lIlIlllIllIIII+1],aaEE_llllIIllllIll,aaEE_IlIllIlllIIlIllllIll=aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_IlIllIlllIIlIllllIll+1 end;return table.concat(aaEE_lIlIlllIllIIII)end;
https://pastebin.com/4HU5pFHZ
Thank you for your answers and explanation
Its called obfuscation (you can look up "lua obfuscator" or "script obfuscator" for more information) and just makes the code unreadable. I've already seen this obfuscation but i can't recall the name of it, its a paid one tho.
This is the best encryption see here.
1 = Let's encrypt lua code com or: LuaEncrypt.exe.
2 = Let's chamar or encrypted lua code.
3 = To call this encrypted code, we will use AmsLuac.dll created in C++
https://github.com/AmsPluginsBox/Encrypt-Lua-Code
I am getting to know NodaTime and like it a lot. But I don't know it that well (yet)!
Given a value such as '2014-04-08T09:30:18Z', what are the steps required to parse such a string to a NodaTime Instant?
Thank you!
I figured this out. For others who want to do the same thing, here is what I used:
var isoString = "2014-04-08T09:30:18Z";
var result = InstantPattern.GeneralPattern.Parse(isoString).Value;
The Value property in this case returns the actual Instant object. If you omit that, the result is of type ParseResult<Instant> in this case, and has other information such as whether the parsing succeeded, etc.
http://nodatime.org/1.2.x/api/html/T_NodaTime_Text_ParseResult_1.htm
There aren't a lot of examples on Noda Time yet, but I am really liking it and turning to it more and more. Fantastic work by the team who created it. Thank you!
In my project i want to store a binary string (string like "010101010101") to memcached and then retrieve it back when needed,
it seems that i can store the string successfully to memcached as "get xxx" gives me a result similar to original one,
but when i use "memcached_get" function to get the result in my code, the return string is not the same to the original binary string,
the length of the return string is much shorter than the original one.
Who can tell my why, is it possible to store binary string to memcached?
Thank you and looking forward your replies~!
Daniel.
Hi Joachim and rekire,
I have solved the problem yet.
I used libmemcache c++ client in my code, the return of "memcache_get" call is char*, i just used string value = string(xxx) to convert the char* to a string.
But actually the binary string contains '\r\n' thus i just got the string before the first '\r\n' and lost the rest data, that's the key point to the problem.
Now i just used string.append(xxx, length) to get the whole binary sequence.
rekire, thanks for your tips, the cause of the problem is similar to your suggestion.
Thank you~!
Hi Im fairly new to base64 code and could do with some info/help etc. I have recently used it while converting my photos into code as part of an experiment regarding my sculptures, I converted a photo into 152 pages of base 64 using an online converter, just to get started. I was wondering how I can reverse this, and also if I edited out some code would the image change or would it not convert at all!? Like I said I am interested in using this to help my experiments. thanks for any info .
Base64 decode functions will decode it. If you remove some of the base64 code it may not translate back into a valid image or translate into valid base64 code at all depending on how much you remove. Depending on how the image was originally compressed, it MAY give you something, but the results will be incredibly unpredictable... So you'll never know what the result of the change will be on the final product. Part of the base64 standard involves a padded width (which is why some strings end in up to 2 = signs).
Hi All
I want to convert the string (taken as input from user) into a secretkey.I am coding in J2ME.The algorithm used is blowfish.
The Java cryptography APIs are not available in Java ME.
You'll need to download the Bouncy Castle lightweight cryptography API, which supports Java ME. You can then extract the classes you need from there. I found a code example here that should help you get started.
About charsets: Java ME does indeed support UTF-8, so that's always a safe bet. And a good idea, yes, although you'll see a lot of code that doesn't specify a charset.
Edit: Please see Eric's answer. This is not available in J2ME.
To convert a string to a key, you can do:
String strkey = "My key goes here";
SecretKeySpec key = new SecretKeySpec(strkey.getBytes("UTF-8"), "Blowfish");