Hi, this is my first post so forgive me if it is uninformed and well, rubbish.

I've taught myself things like Javascripting and PHP and the whole HTML thing from scratch in my free time at work. I work as a Team Manager at a call-centre for a UK based project named Top Up TV.

As part of this, i've been given a spreadsheet that works out "smartcard" offers and engineering rights using Binary and Hexidecimal coding. I need to find a way to distribute this to our staff so they can easily work out what a customer is either receiving, or more likely, not receiving. I cannot use the spreadsheet as it requires an upgrade to excel to work out the binary to hex codes.

Is it possible to use Javascript to reverse engineer an engineering code to work out what offers a customer has?

An example of the engineering code would be as follows.

9000000C00000002

This would translate as the customer having offers 63,60,31,30,1

Recommended Answers

All 4 Replies

Assuming you have the algorithm to reverse engineer the code, sure.

Assuming you have the algorithm to reverse engineer the code, sure.

I only have this within spreadsheet format just now. I need one that would split the 16 characters down individually and go from there, based on their values.

I just want to make a small side note that you can transfer, or better say save, your excel spreadsheets as XML document and use it with PHP or any other language that is able to process it...
This way you can also keep it easily uptodate too.


An example of the engineering code would be as follows.

9000000C00000002

This would translate as the customer having offers 63,60,31,30,1

Expand each hexadecimal digits to binary bits:

0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
A = 1010
B = 1011
C = 1100
D = 1101
E = 1110
F = 1111

So the hexadecimal number:

9000000C00000002

Becomes binary

1001,0000,0000,0000,0000,0000,0000,1100,0000,0000,0000,0000,0000,0000,0000,0010

Each bit is an item. The leftmost bit is item 63, and the rightmost bit is item 0.

The ones are in bit numbers 63, 60, 31, 30, and 1. (bit 0 is rightmost)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.