View previous topic :: View next topic
|
Author |
Message |
nileshbhosle
New User
Joined: 25 Feb 2008 Posts: 9 Location: hydrabad
|
|
|
|
I want to acess the ascii values of character as well as for special character. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Are you looking for this?
The ORD function returns an integer value that is the ordinal position of its argument in the collating sequence for the program. The lowest ordinal position is 1.
Code: |
... FUNCTION ORD(arg1) ... |
The returned value is the ordinal position of arg1 in the collating
sequence for the program; it ranges from 1 to 256 depending on the
collating sequence. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Here is the code for my CHARSET exec.
When you run it, it shows the decimal and the hexadecimal value and the character symbol.
But, this is EBCDIC, not ASCII.
Code: |
/* REXX */
Trace O
Address TSO "#PUT CLEAR"
Line = ""
Do Ix = 0 to 15
Do Iy = 0 to 15
Num = (Ix * 16) + Iy
Line = Line" "Right(Num,3)" "Right(D2X(Num),2)" " D2C(Num)"|"
If Length(Line) > 75 Then Do
Say Line
Line = ""
End
End
End
Say Line
Exit |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I want to acess the ascii values of character as well as for special character. |
Please explain what this is asking. Show with examples. |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
For example, a zero '0' is EBCDIC x'F0' and ASCII x'30'.
Do you want to translate a single character (or string) from EBCDIC to ASCII values within a program? What will you do with it? |
|
Back to top |
|
|
nileshbhosle
New User
Joined: 25 Feb 2008 Posts: 9 Location: hydrabad
|
|
|
|
im doing the password encryption program thts why i require ascii value of alphabets.so whenever i want i can append according to ascii value to password string. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
it would be better if You described a bit more Your environment
in any environment bytes are just bytes,
the ASCII EBCDIC UTF stuff comes out only in regard to "displaying" chars
why in heaven in a mainframe world You need to care about ASCII
all the translation should be automagically carried on by "middleware"
usually all the password stuff is completely being taken care of by appropriate software
Organizational warning!
( seen it done it ) in house password management and encryption stuff
seldom/never pass any serious security auditing/ISO_certification |
|
Back to top |
|
|
nileshbhosle
New User
Joined: 25 Feb 2008 Posts: 9 Location: hydrabad
|
|
|
|
my requirment is i want to calculate total number of capital,small letter and special character and then i want to convert caps in small and small into caps and i want to append the ascii numeric value to entered string along with my
original string+all caps letter converted into small + all small letter into caps + interger value of special so this wil my total password.
then if i hav ascii value then i can easily do this. |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
I don't think you really mean ASCII, you just want to perform math operations on the numeric value of a character.
You probably want to redefine the field or move bytes to a new field defined as numeric and perform your addition. What language are you coding? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Who provided the direction that you need to be concerned with ascii?
If you are entering userid/password on a "mianframe terminal", this will not be an issue.
What is the reason to write something beyond the standard security used on your system? Your application might need to customize menus or show screens differently based on the userid or group, but the security of the application is almost always better served by the standard system security.
As Enrico mentioned, home-grown security code is nearly always weak. |
|
Back to top |
|
|
|