Format --> Hexidecimal It will also convert octal, binary, etc. Mark- [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <1ggv9h0.1iqkryq1bkhsmoN%NoSpam@unknown.net> [ref] => <1ggv7o0.hlilxu7ahw6oN%NoSpam@unknown.net> [htmlstate] => on_nl2br [postusername] => Mark [ip] => NoSpam@unknown. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> decimal to hex util' for OS X? - Mac Programming
Professional Web Applications Themes

decimal to hex util' for OS X? - Mac Programming

Is there a standalone freeware, shareware, utility that is capable of converting large decimal numbers to hexidecimal, that will work with OS X ? (numbers in the billions) Mark-...

  1. #1

    Default decimal to hex util' for OS X?

    Is there a standalone freeware, shareware, utility that is capable of
    converting large decimal numbers to hexidecimal, that will work with OS
    X ?

    (numbers in the billions)

    Mark-
    Mark Guest

  2. #2

    Default Re: decimal to hex util' for OS X?

    net (Mark Conrad) writes:
     

    You mean aside from the GUI Calculator that came with OS X?

    open it up, type in the big decimal number you want, then
    go to the menubar and look for View->Display Format->Hexadecimal.


    Now, that's rather bersome if you need to do a lot
    of them and want to script it up somehow. In that case,
    your shell can do it:

    Assuming you are using bash or zsh:

    $ printf '%x\n', 987654321987
    e5f4c8f743

    for example.

    For more information,

    man zshbuiltins
    or
    man bash

    and look for the builtin 'printf'

    Then, to learn about print formats, (ie. to find out
    that the formatter you want is %x),

    man printf

    Actually, any program or language which gives you access
    to printf gets you some handy conversion functions.

    --
    Plain Bread alone for e-mail, thanks. The rest gets trashed.
    No HTML in E-Mail! -- http://www.expita.com/nomime.html
    Are you posting responses that are easy for others to follow?
    http://www.greenend.org.uk/rjk/2000/06/14/quoting
    BreadWithSpam@fractious.net Guest

  3. #3

    Default Re: decimal to hex util' for OS X?

    Mark Conrad <net> wrote:
     

    Whoops! - sorry everyone, I already found the OSX utility, right in
    front of my eyes.

    The ordinary OS X Calculator utility dropdown "View" menu:

    View --> Format --> Hexidecimal

    It will also convert octal, binary, etc.


    Mark-
    Mark Guest

  4. #4

    Default Re: decimal to hex util' for OS X?

    <net> wrote:
     
    >
    > You mean aside from the GUI Calculator that came with OS X?[/ref]

    Yipes! - you really replied quickly <g>

    I found the OSX Calculator capabilities immediately after I posted the
    opening post here, but by that time you had already responded. :)

    Teaches me a lesson, look a bit harder before I yell for help.

    Very good about your suggestion to do the same conversion from Terminal,
    I will try that also.

    Mark-
    Mark Guest

  5. #5

    Default Re: decimal to hex util' for OS X?

    Mark Conrad wrote:
     [/ref]

    Can use 'dc' at the shell; very useful and nearly ubiquitous.
    If you've used an RPN calculator, you'll be right at home.
    Example follows; comments were added afterwards:

    $ dc
    16 o # set hex output base
    1234567689123456789123456789 p # decimal in, print hex
    3FD35E0880A078357545F15
    2 64 ^ p # show 2 ** 64
    10000000000000000
    q
    $



    Mike Guest

  6. #6

    Default Re: decimal to hex util' for OS X?

    Mike Hall <enteract.com> wrote:
     
    >
    > Can use 'dc' at the shell; very useful and nearly ubiquitous.
    > If you've used an RPN calculator, you'll be right at home.
    > Example follows; comments were added afterwards:
    >
    > $ dc
    > 16 o # set hex output base
    > 1234567689123456789123456789 p # decimal in, print hex
    > 3FD35E0880A078357545F15
    > q[/ref]


    That works great -
    Below is an example where I used "dc" to convert your hex number back
    to its original decimal number:

    dc
    10 o (this line sets the output base)
    16 i (this line sets the input base)
    3FD35E0880A078357545F15 p (hex in, print decimal)
    1234567689123456789123456789 (decimal output result)
    q (quit the "dc" utility)


    ....or this much simplier example:

    dc
    10 o
    16 i
    FF p
    255
    q

    Thank you very much for that enlightenment about "dc".

    Mark-
    Mark Guest

  7. #7

    Default Re: decimal to hex util' for OS X?

    In article <1ggvx87.qoill511uku1mN%net>,
    net (Mark Conrad) wrote:
     

    dc is nice, but I would just use google for the conversion. Just type
    "0xdeadbeef in decimal" into google and you are done.

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  8. #8

    Default Re: decimal to hex util' for OS X?

    Miro Jurisic <org> wrote:
     
    >
    > dc is nice, but I would just use google for the conversion. Just type
    > "0xdeadbeef in decimal" into google and you are done.[/ref]

    Wow! - yet another way, and that would work for anyone who did not have
    the command-line to play with.

    On a related note, I can now see why someone who is expert at the
    Unix/Linux/OSX command-line stuff would have a distinct advantage over
    someone who only knows a point-and-click GUI.

    Of course, none of us will live long enough to become expert at all of
    the command-line stuff. :)

    If I was not so lazy, I would grind out a standalone Lisp-language
    utility that would convert any base to any base.

    Thanks for that google tip.

    Mark-
    Mark Guest

Similar Threads

  1. SNMP::Util
    By Marcel van Leeuwen in forum PERL Modules
    Replies: 4
    Last Post: April 10th, 05:57 PM
  2. java.util.zip.ZipOutputStream
    By cicovec-at-hotmail in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: May 12th, 07:36 PM
  3. util.scand calculation not working
    By Mark_A_Gray@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 2
    Last Post: June 22nd, 01:02 PM
  4. List::Util / arrays
    By Jeff 'Japhy' Pinyan in forum PERL Beginners
    Replies: 0
    Last Post: August 6th, 02:57 AM
  5. programatic CPU util
    By Rick Jones in forum AIX
    Replies: 1
    Last Post: July 8th, 12:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139