Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:18:16+00:00 2026-05-26T18:18:16+00:00

The octets from Hello world are: E8 32 9B FD 06 DD DF 72

  • 0

The octets from “Hello world” are: E8 32 9B FD 06 DD DF 72 36 19

And if apply padding it will become : D0 65 36 FB 0D BA BF E5 6C 32

(copy from wiki)

Can I know what’s the formula to encoding with 1-bit padding?

Here is the formula of convert string to PDU that I edited :(thanks to source provider)
*The whole complete formula is kinda long so I just post a part of it here…

    maxkeys = 160;

    function binToInt(x)//sp
   {
var total = 0;  
var power = parseInt(x.length)-0;   

for(var i=0;i<x.length;i++)
{
    if(x.charAt(i) == '1')
    {
     total = total +Math.pow(2,power);
    }
    power --;
}
return total;
  }

  function intToHex(i) //sp
    {
     var sHex = "0123456789ABCDEF"; 
     h = ""; 
     i = parseInt(i);   
    for(j = 0; j <= 3; j++)
     {
      h += sHex.charAt((i >> (j * 8 + 4)) & 0x0F) +
        sHex.charAt((i >> (j * 8)) & 0x0F);
      }
    return h.substring(0,2);
   }


 function stringToPDU(inpString,size) 
     {

var bitSize = size[0].value * size[0].checked | size[1].value * size[1].checked | size[2].value * size[2].checked;

var octetFirst = "";
var octetSecond = ""; 
var output = "";

var DATA_ENCODING = "00"; 

var VALID_PERIOD = "AA";

var userDataSize;
if (bitSize == 7)
{

    userDataSize = intToHex(inpString.length);

    for(var i=0;i<=inpString.length;i++)
    {
        if(i==inpString.length)
        {
            if (octetSecond != "") // AJA Fix overshoot
            {
                output = output + "" + (intToHex(binToInt(octetSecond)));
            }
            break;
        }
        var current = intToBin(getSevenBit(inpString.charAt(i)),7);

        var currentOctet;
        if(i!=0 && i%8!=0)
        {
            octetFirst = current.substring(7-(i)%8);
            currentOctet = octetFirst + octetSecond;    

            output = output + "" + (intToHex(binToInt(currentOctet)));
            octetSecond = current.substring(0,7-(i)%8); 
        }
        else
        {
            octetSecond = current.substring(0,7-(i)%8);
        }   
    }
}

//var data =  DATA_ENCODING + VALID_PERIOD + userDataSize;

var PDU =   output;

return  PDU;
      }

    <input onclick="pduOut.value= stringToPDU(document.stringToPduForm.smsText.value.substring (0, maxkeys),document.stringToPduForm.size);" type="button" size="11" value="  Convert  " name="stringButton">

I need to know what changes needed so that the formula can encode message with 1-bit padding..but I not really understand the concept,can someone teach me?
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:18:16+00:00Added an answer on May 26, 2026 at 6:18 pm

    Write out those octets in binary (with the lowest bit first in each octet) and you’ll see it:

    E8 32 9B FD 06 DD DF 72 36 19 = 00010111 01001100 11011001 10111111 01100000 10111011 11111011 01001110 01101100 10011000
    D0 65 36 FB 0D BA BF E5 6C 32 = 00001011 10100110 01101100 11011111 10110000 01011101 11111101 10100111 00110110 01001100
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have a SWF clip that I got from a friend. the code
I'm trying to use JSPack to convert from double to array of octets. This
I know substring can handle this but, is there a better way to get
I'm trying to save email attachment from Google mail account. AFAIK, it can be
A JSON string can contain the escape sequence: \u four-hex-digits, which are two octets.
I managed to get a unsigned long int octets-representation (BE) by reading IPv4 methods,
It's from here ,but fails when compiling: int main(int argc, char **argv) { struct
I am currently exporting data from php to excel using the code as below:
I have to get response text from a resourceindex page as JSON object. When
I would like to serve xbaps from the VS web dev server (cassini) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.