From a18d1a107e49525efd1561f396f6b2be28ab5224 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Sat, 9 Mar 2013 13:47:09 +0100 Subject: Use simpler keyid with 5 digits Change-Id: Iac743d4f298b43067fe5db9199eb39c3301f827e --- l10ntools/source/po.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'l10ntools/source/po.cxx') diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 99e113b2739f..cdb5fb4db202 100755 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -264,16 +264,16 @@ namespace boost::crc_32_type aCRC32; aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength()); sal_uInt32 nCRC = aCRC32.checksum(); - //Use all readable ASCII character exclude xml special tags: ",',&,<,> + ///Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs static const OString sSymbols = - "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - char sKeyId[5]; - for( short nKeyInd = 0; nKeyInd < 4; ++nKeyInd ) + "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789"; + char sKeyId[6]; + for( short nKeyInd = 0; nKeyInd < 5; ++nKeyInd ) { - sKeyId[nKeyInd] = sSymbols[(nCRC & 255) % 89]; - nCRC >>= 8; + sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % sSymbols.getLength()]; + nCRC >>= 6; } - sKeyId[4] = '\0'; + sKeyId[5] = '\0'; return OString(sKeyId); } -- cgit