LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's the best way to copy a static variable from C into LabVIEW?

Solved!
Go to solution

As an interesting/fun project, I'm trying to implement the bcrypt algorithm in some native G, without using any libraries (eg no DLL linkage, all native G code). All is going well for now, except for a minor roadblock I've run into. Part of the bcrypt algorithm involves initializing a state variable with a 4x256 array of hex codes derived from the digits of pi. In the C code, it looks like:

 

unsigned int BF_init_state = {
	{
		{
			// S row 1 initial state
		}, {
			// S row 2 initial state
		}, {
			// S row 3 initial state
		}, {
			// S row 4 initial state
		}
	}, {
		// P initial state goes here
	}
};

I know this should be amenable to some kind of JSON import, or maybe directly via the Data Operations menu, but I'm not 100% certain on the best way to do it. Any ideas?

 

I've truncated the rows, so if you're interested in the full code, check out crypt_blowfish.c over on Github.

0 Kudos
Message 1 of 3
(3,379 Views)
Solution
Accepted by topic author ijustlovemath

This will only do one row/column at a time, but I think this is what you are looking for.

 

Text to Array.png

0 Kudos
Message 2 of 3
(3,356 Views)

Thanks, this is perfect. And so simple!

0 Kudos
Message 3 of 3
(3,347 Views)