private static string GetMetaLengthBin(int nDataLength)
{
//Steps to calculate the meta length in characters
//STEP 1: Get the div part. Divide data length by 256
//STEP 2: Get the Modulus part. Take modulus of Data length by 256
//STEP 3: Convert into characters, concat and return.
string strLengthInChars = string.Empty;
int nPartDiv = nDataLength / 256;
int nPartMod = nDataLength % 256;
char chDiv = Convert.ToChar(nPartDiv);
char chMod = Convert.ToChar(nPartMod);
strLengthInChars = chDiv.ToString() + chMod.ToString();
return strLengthInChars;
}
Thursday, March 26, 2009
Calculate meta length!
How to calculate meta length in characters:
| Reactions: |
Tuesday, March 24, 2009
HSM Simulator
Released on Mar 8th, an excellent resource was forwarded by a friend, is a software based open implementation of HSM, Hardware security module. The HSM simulator is a library that provides almost all of the functionalities offered by Thales HSM. Almost all means, that several commands were not implemented fully (like the PA-Load Formatting Data whose sole implementation task is to respond to the host application) or not at all (like commands that have to do with the IBM verification method).
Thales Simulator Library
Thales Simulator Library
Subscribe to:
Posts (Atom)
Popular Posts
-
Sometime back a question was asked to develop a well performant parser– there was no restriction defined in the question whatsoever as to wh...
-
Windows Communication Foundation (WCF): Why use MessageContract when DataContract is there? UPDATED 07/15/2012: Based upon comments Nutsh...
-
Recently, I had to go through the implementation of a cheque clearing system; so, either because of the naive skull sticked on the top of my...
-
Problem Response is really slow when a page of ASP.NET/MVC web(site or app) is accessed first time. It takes around(depending?) 4/5 second...
-
Crystal Report Viewer "This field name is not known.” Error! I was using Crystal Reports Viewer control in my ASP.NET web application...
-
How bypass integrated authentication using WebBrowser control? Well, sometime back, I was hosting the WebBrowser control over WinForm and ...
-
This is a second post to the sequel to Jurgen Appelo ’s blog post , where he asks top 100 questions that a software developer should know. ...
-
Couple of days ago I came across the following question over our local web blog, and following is what I replied. Question: [Discuss]: A...
-
Crystal Reports: PrintControl.Cab ActiveX problem Problem: I have a crystal report (some version) with asp.net (usually v2.0), I am using...
-
This post is inspired by Jurgen Appelo ’s blog post , where he asks top 100 questions that a software developer should know. The questions a...