Chunked Transfer Encoding

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Implement HTTP/1.1's chunked transfer encoding. It consists of repeated chunks of the form:
<n=size in hex>\n<n bytes>\n
And ends with a zero chunk 0\n\n

Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

Sample input:_

1a
1:1 In the beginning God c
1f
reated the heaven and the earth
36
.

1:2 And the earth was without form, and void; and d
26
arkness was upon
the face of the deep.
1f
 And the Spirit of God moved up
29
on the face of the
waters.

1:3 And God s
5
aid, 
1d
Let there be light: and there
2f
 was light.

1:4 And God saw the light, that it
35
 was good: and God divided the light
from the darknes
d
s.

1:5 And G
13
od called the light
26
 Day, and the darkness he called Night
37
.
And the evening and the morning were the first day.


b
1:6 And God
3e
 said, Let there be a firmament in the midst of the waters,
an
1c
d let it divide the waters f
12
rom the waters.

1
c
:7 And God m
1f
ade the firmament, and divided 
1c
the waters which were
under 
20
the firmament from the waters wh
14
ich were above the f
36
irmament:
and it was so.

1:8 And God called the firma
10
ment Heaven. And
3d
 the evening and the
morning were the second day.

1:9 And Go
23
d said, Let the waters under the he
3b
aven be gathered together
unto one place, and let the dry l
3a
and appear: and it was so.

1:10 And God called the dry la
17
nd Earth; and the gathe
13
ring together of
th
6
e wate
22
rs called he Seas: and God saw tha
b
t it was go
16
od.

1:11 And God said
3f
, Let the earth bring forth grass, the herb yielding
seed, and 
27
the fruit tree yielding fruit after his
1b
 kind, whose seed is
in its
3
elf
2b
, upon the earth: and it was so.

1:12 And 
1a
the earth brought forth gr
11
ass, and herb yie
1b
lding seed after
his kind, 
d
and the tree 
11
yielding fruit, w
3f
hose seed was in itself, after
his kind: and God saw that it wa
2
s 
1c
good.

1:13 And the evening 
2f
and the morning were the third day.

1:14 And G
a
od said, L
26
et there be lights in the firmament of
1d
 the heaven
to divide the day
10
 from the night;
30
 and let them be for signs, and for
seasons, and
36
 for days, and years: 1:15 And let them be for lights 
24
in
the firmament of the heaven to gi
19
ve light upon the earth: 
1b
and it was
so.

1:16 And Go
18
d made two great lights;
19
 the greater light to rul
3e
e the day,
and the lesser light to rule the night: he made the
3
 st
1c
ars also.

1:17 And God set 
14
them in the firmamen
9
t of the 
9
heaven to
f
 give light
upo
34
n the earth, 1:18 And to rule over the day and over 
1a
the night, and
to divide t
5
he li
2
gh
3c
t from the darkness: and God saw that it was good.

1:19 And
8
 the eve
23
ning and the morning were the fourt
2d
h day.

1:20 And God said, Let the waters bri
2b
ng forth abundantly the moving
creature tha
a
t hath lif
d
e, and fowl t
22
hat may fly above the earth in the
15

open firmament of he
1f
aven.

1:21 And God created gre
4
at w
31
hales, and every living creature that
moveth, whi
31
ch the waters brought forth abundantly, after the
12
ir kind,
and every
3b
 winged fowl after his kind: and God saw that it was good.

17

1:22 And God blessed t
34
hem, saying, Be fruitful, and multiply, and fill
the
32
 waters in the seas, and let fowl multiply in the 
5
earth
7
.

1:23
17
 And the evening and th
10
e morning were t
f
he fifth day.


39
1:24 And God said, Let the earth bring forth the living c
6
reatur
27
e after
his kind, cattle, and creeping 
4
thin
12
g, and beast of th
14
e earth after his
ki
9
nd: and i
17
t was so.

1:25 And God
16
 made the beast of the
13
 earth after his ki
13
nd, and cattle
afte
1d
r their kind, and every thing
3c
 that creepeth upon the earth after
his kind: and God saw th
9
at it was
2a
 good.

1:26 And God said, Let us make man
20
 in our image, after our likenes
39
s:
and let them have dominion over the fish of the sea, a
13
nd over the fowl
of
39
 the air, and over the cattle, and over all the earth, an
32
d over
every creeping thing that creepeth upon the
2
 e
1a
arth.

1:27 So God created
3
 ma
21
n in his own image, in the image 
8
of God c
39
reated
he him; male and female created he them.

1:28 And
14
 God blessed them, a
13
nd God said unto th
36
em, Be fruitful, and
multiply, and replenish the earth
6
, and 
16
subdue it: and have do
24
minion
over the fish of the sea, and
39
 over the fowl of the air, and over every
living thing th
1e
at moveth upon the earth.

1:2
3e
9 And God said, Behold, I have given you every herb bearing se
20
ed,
which is upon the face of al
21
l the earth, and every tree, in t
10
he which
is the 
3c
fruit of a tree yielding seed; to you it shall be for meat.

38

1:30 And to every beast of the earth, and to every fowl
12
 of the air,
and t
29
o every thing that creepeth upon the eart
15
h, wherein there is
l
a
ife, I hav
27
e given every green herb for meat: and 
2a
it was so.

1:31 And God saw every thing t
3b
hat he had made, and, behold, it was
very good. And the eve
17
ning and the morning we
2b
re the sixth day.

2:1 Thus the heavens and
6
 the e
3c
arth were finished, and all the host of
them.

2:2 And on th
39
e seventh day God ended his work which he had made; and
h
1
e
2c
 rested on the seventh day from all his work
34
 which he had made.

2:3 And God blessed the seventh
32
 day, and sanctified it: because that
in it he had
39
 rested from all his work which God created and made.

2:
9
4 These a
23
re the generations of the heavens a
1f
nd of the earth when
they were 
26
created, in the day that the LORD God 
3b
made the earth and the
heavens, 2:5 And every plant of the 
39
field before it was in the earth,
and every herb of the f
3a
ield before it grew: for the LORD God had not
caused it to
21
 rain upon the earth, and there w
5
as no
2c
t a man to till the
ground.

2:6 But there w
1e
ent up a mist from the earth, 
1e
and watered the whole
face of 
4
the 
20
ground.

2:7 And the LORD God fo
4
rmed
5
 man 
3a
of the dust of the ground, and
breathed into his nostrils 
3d
the breath of life; and man became a living
soul.

2:8 And th
2
e 
19
LORD God planted a garden
a
 eastward 
11
in Eden; and ther
26
e he
put the man whom he had formed.


24
2:9 And out of the ground made the L
28
ORD God to grow every tree that is
pleas
32
ant to the sight, and good for food; the tree of l
1b
ife also in the
midst of th
3f
e garden, and the tree of knowledge of good and evil.

2:10 And
22
 a river went out of Eden to water
37
 the garden; and from thence
it was parted, and became 
24
into four heads.

2:11 The name of t
c
he first is 
3d
Pison: that is it which compasseth the
whole land of Havilah,
29
 where there is gold; 2:12 And the gold o
31
f that
land is good: there is bdellium and the on
3
yx 
18
stone.

2:13 And the nam
21
e of the second river is Gihon: t
2f
he same is it that
compasseth the whole land of
19
 Ethiopia.

2:14 And the 
27
name of the third river is Hiddekel: th
1a
at is it which
goeth towar
3b
d the east of Assyria. And the fourth river is Euphrates.


26
2:15 And the LORD God took the man, an
22
d put him into the garden of
Eden 
1e
to dress it and to keep it.

2
25
:16 And the LORD God commanded the ma
3d
n, saying, Of every tree of the
garden thou mayest freely eat
2f
: 2:17 But of the tree of the knowledge
of good
20
 and evil, thou shalt not eat of
2a
 it: for in the day that thou
eatest there
2d
of thou shalt surely die.

2:18 And the LORD 
32
God said, It is not good that the man should be
al
c
one; I will 
c
make him an 
13
help meet for him.

f

2:19 And out o
36
f the ground the LORD God formed every beast of the
fi
36
eld, and every fowl of the air; and brought them unto 
1
A
6
dam to
3c
 see
what he would call them: and whatsoever Adam called eve
34
ry living
creature, that was the name thereof.

2:20
30
 And Adam gave names to all cattle, and to the f
15
owl of the air,
and t
2a
o every beast of the field; but for Adam t
10
here was not fou
24
nd an
help meet for him.

2:21 And t
3
he 
15
LORD God caused a dee
15
p sleep to fall upon 
1b
Adam, and he
slept: and he 
4
took
23
 one of his ribs, and closed up the
11
 flesh instead
th
34
ereof; 2:22 And the rib, which the LORD God had take
13
n from man, made
he
32
 a woman, and brought her unto the man.

2:23 And 
1b
Adam said, This is now bone
1c
 of my bones, and flesh of m
37
y
flesh: she shall be called Woman, because she was tak
4
en o
20
ut of Man.

2:24 Therefore shall
15
 a man leave his fath
28
er and his mother, and shall
cleave unto
14
 his wife: and they 
d
shall be one 
1
f
3b
lesh.

2:25 And they were both naked, the man and his wife,
12
 and were not
asha
2
me
3
d.

0

Sample output:

1:1 In the beginning God created the heaven and the earth.

1:2 And the earth was without form, and void; and darkness was upon
the face of the deep. And the Spirit of God moved upon the face of the
waters.

1:3 And God said, Let there be light: and there was light.

1:4 And God saw the light, that it was good: and God divided the light
from the darkness.

1:5 And God called the light Day, and the darkness he called Night.
And the evening and the morning were the first day.

1:6 And God said, Let there be a firmament in the midst of the waters,
and let it divide the waters from the waters.

1:7 And God made the firmament, and divided the waters which were
under the firmament from the waters which were above the firmament:
and it was so.

1:8 And God called the firmament Heaven. And the evening and the
morning were the second day.

1:9 And God said, Let the waters under the heaven be gathered together
unto one place, and let the dry land appear: and it was so.

1:10 And God called the dry land Earth; and the gathering together of
the waters called he Seas: and God saw that it was good.

1:11 And God said, Let the earth bring forth grass, the herb yielding
seed, and the fruit tree yielding fruit after his kind, whose seed is
in itself, upon the earth: and it was so.

1:12 And the earth brought forth grass, and herb yielding seed after
his kind, and the tree yielding fruit, whose seed was in itself, after
his kind: and God saw that it was good.

1:13 And the evening and the morning were the third day.

1:14 And God said, Let there be lights in the firmament of the heaven
to divide the day from the night; and let them be for signs, and for
seasons, and for days, and years: 1:15 And let them be for lights in
the firmament of the heaven to give light upon the earth: and it was
so.

1:16 And God made two great lights; the greater light to rule the day,
and the lesser light to rule the night: he made the stars also.

1:17 And God set them in the firmament of the heaven to give light
upon the earth, 1:18 And to rule over the day and over the night, and
to divide the light from the darkness: and God saw that it was good.

1:19 And the evening and the morning were the fourth day.

1:20 And God said, Let the waters bring forth abundantly the moving
creature that hath life, and fowl that may fly above the earth in the
open firmament of heaven.

1:21 And God created great whales, and every living creature that
moveth, which the waters brought forth abundantly, after their kind,
and every winged fowl after his kind: and God saw that it was good.

1:22 And God blessed them, saying, Be fruitful, and multiply, and fill
the waters in the seas, and let fowl multiply in the earth.

1:23 And the evening and the morning were the fifth day.

1:24 And God said, Let the earth bring forth the living creature after
his kind, cattle, and creeping thing, and beast of the earth after his
kind: and it was so.

1:25 And God made the beast of the earth after his kind, and cattle
after their kind, and every thing that creepeth upon the earth after
his kind: and God saw that it was good.

1:26 And God said, Let us make man in our image, after our likeness:
and let them have dominion over the fish of the sea, and over the fowl
of the air, and over the cattle, and over all the earth, and over
every creeping thing that creepeth upon the earth.

1:27 So God created man in his own image, in the image of God created
he him; male and female created he them.

1:28 And God blessed them, and God said unto them, Be fruitful, and
multiply, and replenish the earth, and subdue it: and have dominion
over the fish of the sea, and over the fowl of the air, and over every
living thing that moveth upon the earth.

1:29 And God said, Behold, I have given you every herb bearing seed,
which is upon the face of all the earth, and every tree, in the which
is the fruit of a tree yielding seed; to you it shall be for meat.

1:30 And to every beast of the earth, and to every fowl of the air,
and to every thing that creepeth upon the earth, wherein there is
life, I have given every green herb for meat: and it was so.

1:31 And God saw every thing that he had made, and, behold, it was
very good. And the evening and the morning were the sixth day.

2:1 Thus the heavens and the earth were finished, and all the host of
them.

2:2 And on the seventh day God ended his work which he had made; and
he rested on the seventh day from all his work which he had made.

2:3 And God blessed the seventh day, and sanctified it: because that
in it he had rested from all his work which God created and made.

2:4 These are the generations of the heavens and of the earth when
they were created, in the day that the LORD God made the earth and the
heavens, 2:5 And every plant of the field before it was in the earth,
and every herb of the field before it grew: for the LORD God had not
caused it to rain upon the earth, and there was not a man to till the
ground.

2:6 But there went up a mist from the earth, and watered the whole
face of the ground.

2:7 And the LORD God formed man of the dust of the ground, and
breathed into his nostrils the breath of life; and man became a living
soul.

2:8 And the LORD God planted a garden eastward in Eden; and there he
put the man whom he had formed.

2:9 And out of the ground made the LORD God to grow every tree that is
pleasant to the sight, and good for food; the tree of life also in the
midst of the garden, and the tree of knowledge of good and evil.

2:10 And a river went out of Eden to water the garden; and from thence
it was parted, and became into four heads.

2:11 The name of the first is Pison: that is it which compasseth the
whole land of Havilah, where there is gold; 2:12 And the gold of that
land is good: there is bdellium and the onyx stone.

2:13 And the name of the second river is Gihon: the same is it that
compasseth the whole land of Ethiopia.

2:14 And the name of the third river is Hiddekel: that is it which
goeth toward the east of Assyria. And the fourth river is Euphrates.

2:15 And the LORD God took the man, and put him into the garden of
Eden to dress it and to keep it.

2:16 And the LORD God commanded the man, saying, Of every tree of the
garden thou mayest freely eat: 2:17 But of the tree of the knowledge
of good and evil, thou shalt not eat of it: for in the day that thou
eatest thereof thou shalt surely die.

2:18 And the LORD God said, It is not good that the man should be
alone; I will make him an help meet for him.

2:19 And out of the ground the LORD God formed every beast of the
field, and every fowl of the air; and brought them unto Adam to see
what he would call them: and whatsoever Adam called every living
creature, that was the name thereof.

2:20 And Adam gave names to all cattle, and to the fowl of the air,
and to every beast of the field; but for Adam there was not found an
help meet for him.

2:21 And the LORD God caused a deep sleep to fall upon Adam, and he
slept: and he took one of his ribs, and closed up the flesh instead
thereof; 2:22 And the rib, which the LORD God had taken from man, made
he a woman, and brought her unto the man.

2:23 And Adam said, This is now bone of my bones, and flesh of my
flesh: she shall be called Woman, because she was taken out of Man.

2:24 Therefore shall a man leave his father and his mother, and shall
cleave unto his wife: and they shall be one flesh.

2:25 And they were both naked, the man and his wife, and were not
ashamed.

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1rotary-o260.01762026/03/26 01:06:070B / 12B / 12B
2teebee260.01742026/03/29 18:35:350B / 12B / 12B
3NicknamedTwice260.01752026/04/08 07:48:410B / ?B / ?B
4Natte380.05562026/03/25 18:51:370B / 30B / 5B
5MeWhenI590.01802026/03/25 11:16:150B / 20B / 34B

Ruby2 _

RankUserSizeTimeDateStatistics
1rotary-o230.06532026/03/26 01:05:160B / 13B / 7B
2Sisyphus260.05842026/03/26 11:26:070B / 12B / 12B
3NicknamedTwice260.06022026/04/08 07:38:300B / ?B / ?B

Perl _

RankUserSizeTimeDateStatistics
1rotary-o260.01512026/03/26 08:17:040B / 16B / 7B
2Sisyphus260.01532026/03/26 11:36:090B / 16B / 7B
3fuzzylojik260.01712026/03/26 23:13:300B / 16B / 7B
4teebee260.04322026/03/27 04:26:000B / 16B / 7B
5tails290.01812026/03/25 23:52:090B / 21B / 5B
6Natte290.01802026/03/26 00:21:460B / 21B / 5B

Python3 _

RankUserSizeTimeDateStatistics
1NicknamedTwice560.04762026/04/08 07:18:180B / 34B / 18B

iogii _

RankUserSizeTimeDateStatistics
1darrenks300.73822026/03/27 06:14:200B / 18B / 11B

C _

RankUserSizeTimeDateStatistics
1tails580.01422026/03/29 20:07:380B / 32B / 26B
2rotary-o580.01422026/04/02 00:53:120B / 32B / 26B

Java _

RankUserSizeTimeDateStatistics
1rotary-o1290.07422026/03/29 09:38:590B / 78B / 47B

C# _

RankUserSizeTimeDateStatistics
1rotary-o1350.07022026/03/29 09:39:110B / 86B / 44B

sed _

RankUserSizeTimeDateStatistics
1tails500.01602026/03/25 23:46:030B / 20B / 26B

Bash _

RankUserSizeTimeDateStatistics
1McBusLuck271.08232026/04/06 20:20:270B / 13B / 11B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails490.07012026/03/26 03:31:390B / 23B / 16B
2McBusLuck610.49742026/03/30 16:32:540B / 30B / 22B
3tails480.07392026/04/08 12:59:470B / 23B / 15B

Whitespace _

RankUserSizeTimeDateStatistics
1rotary-o1340.14792026/04/08 00:41:380B / 0B / 0B

gs2 _

RankUserSizeTimeDateStatistics
1whio170.09632026/03/31 05:52:233B / 5B / 5B
2tails192.26952026/03/29 23:23:087B / 4B / 8B
3tails (whio)160.13742026/04/08 13:05:033B / 4B / 5B

Nibbles _

RankUserSizeTimeDateStatistics
1whio110.02992026/03/30 22:42:558B / 0B / 2B

Lazy-K _

RankUserSizeTimeDateStatistics
1tails5190.64172026/03/26 00:49:500B / 284B / 235B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o793.69852026/03/29 17:54:440B / 46B / 32B

Language Ranking_

RankLangUserSizeScore
1Nibbleswhio1110000
2gs2tails (whio)166875
3Ruby2rotary-o234782
4Rubyrotary-o264230
5Perlrotary-o264230
6BashMcBusLuck274074
7iogiidarrenks303666
8Bash (builtins)tails482291
9sedtails502200
10Python3NicknamedTwice561964
11Ctails581896
12Scalarotary-o791392
13Javarotary-o129852
14Whitespacerotary-o134820
15C#rotary-o135814
16Lazy-Ktails519211

return to the top page