A system I'm working on needs to generate and store unique codes that will be distributed to its users. Any user can then enter one of these codes to obtain a discount at the basket.
Because the codes are there for anybody's taking they need to be random enough that users who shouldn't have one shouldn't be able to go guessing them.
The codes will be handed out ad-hoc to users who will take the code and enter it at the basket. Nothing ties the code to any given user though.
The code I've come up with to generate the codes (read "pasted and modified off Google") is like this:
private readonly Random _rng = new Random();
private const string _chars = "ABCDEFGHJKLMNPQRSTWXY3456789"; public static string Generate(int size){char[] buffer = new char[size]; for (int i = 0; i < size; i++){ buffer[i] = _chars[_rng.Next(_chars.Length)]; }return new string(buffer);
}
Notice that I've left out confusingly-similar characters combinations such as I and 1, Z and 2. Going further I could probably miss out S and 5 as well as 8 and B?
The issue I have is one of compromise. How do I balance uniqueness and "security" with ease of entry for the end user?
A string that's 8 characters long might not look too hard to guess, but is in fact fairly unique.
If the set of characters used has 28 members and the string is 8 characters long then the chance of guessing a code is one in 28^8 or 28 to the power or 8 or 28*28*28*28*28*28*28*28 or 377,801,998,336.
Assuming my maths is right?
Here's how some other combinations stack up:
Possible Characters
Code Length
Permutations
28
12
232,218,265,089,212,416
28
8
377,801,998,336
28
6
481,890,304
28
4
614,656
10
10
10,000,000,000
10
3
1,000
Maybe a code 8 characters long is too much. Probably 6 would suffice. What would you opt for?
Just a little test. This is a normal blog entry (written in Windows Live Writer) that I'll tweak in the background once it's published to add a survey to it.
All being well you should see a survey on this page -assuming you've opened the page proper, rather than just looking at the homepage, which is a view and so won't work.
Fredrik Malmborg looks at why IBM Lotus allows in-place upgrades instead of insisting data be migrated to a new version. He includes a link to an article explaining the benefits of doing migrations instead of in-place upgrades (featuring another mail system).
Asking if you guys are Domino Developers might seem a daft question, but I've always been curious to know exactly who my readers are. So, this is the first in a series of questions to help me discover who you guys are.
It might also offer an insight in to how many Domino developers are looking/moving to other skills.
So, now that the new surveys feature has bedded in, here the first question proper.
There is a survey running with this blog post. Please visit this site to in order to vote.
Today SmartUpgrade can only be used for Notes clients, but servers can not be upgraded nor patched from a central console
To manage large Domino environments it would be useful to have a Domino application on a central server, from which the Admin can control:
- which server in the environment will receive which SW upgrade or FixPack
- when to apply the upgrade/patch/fixpack
This way it would be possible to automate and simplify server upgrades even in a complex environment.
Note : this idea was proposed in a different place some years back. Now I'd like to see if Admin's are interested in a tool like that, and (if yes) request IBM / Lotus to build it.
Upon request I have developed two web banners that can be used to help promote OpenNTF: These banners have also been added to the OpenNTF marketing material ...
The ToDo list in the Activities application offers a great place to mange task assigned to other people in the "Created by Me" section.
Clicking on a task expands the description however to view any related commnents, we are force to selcet >More Actions > Show in Activity and navigate away from the ToDo list.
A collapsible section for the comments under each task is essential to providing better work flow.
Currently, it is tedious to verify the status of multiple tasks due to lack of vivisibility to the related comments in the ToDo list context.
In his keynote at DNUG
today Kevin Cavanaugh, Vice President, Messaging and Collaboration, demonstrated
the new web site for XPages developers XPages.info
and emphasized the strategic importance of XPages for Lotus. Sorry for the bad quality of ...
Table of Contents Previous Page Next Page Lotus Notes of the Windows Installer technology, which allows an administrator to standardize custom installations by distributing preconfigured installation packages. The administrator manipulates the configuration by means of a transform ...
The Utility subdirectory in the Notes install kit contains a single zip file (NotesCustomizationKit10.zip) in which the following individual Notes install customization tools reside: addToKit.exe enables you to add signed features to the install kit trimUpdateSite.zip enables you to ...
Notes 8.5.1 and greater can be installed or upgraded on Windows and Citrix platforms in conjunction with a customized data directory specification. This new functionality is documented ...