Generate P2WSH native
Bech32 encoding, apart from the checksum, is a simple matter of converting base-256 (8-bits) to base-32 (5-bits). Base-256 is the byte array (octet string) that you get from a hash function. Only focusing on first 3 bytes of the hash:  

as hex    = 0x18     0x63     0x14 
as bytes  = 24       99       20 
as binary = 00011000 01100011 00010100 


In order to convert the above base-256 (8-bits) input to base-32 (5-bits) we start from the most significant bit and select 5 bits at a time until we run out.  

12345123 45123451 23451234 ...
00011000 01100011 00010100
(00011) (00001) (10001) (10001) (0100 ...


For a bech-32 address there is an extra step here after the base conversion is done. That step is to append of the "witness version" to the beginning of this group as an already converted value in base-32 (since witness version is defined from 0 to 16 inclusive it is already in range).  

[00000] (00011) (00001) (10001) (10001) (0100 ...


This final result can be converted to an array of numbers that are between 0 and 31  

0, 3, 1, 17, 17


To convert this "number" array to human readable format we print the corresponding character from the bech32 charset (qpzry9x8gf2tvdw0s3jn54khce6mua7l)

0-&gt;q, 3-&gt;r, 1-&gt;p, 17-&gt;3, 17-&gt;3 ...


P.S. There is a checksum calculation that I skipped to keep it simple but it is just another appended set of 5-bit values at the end of what we have in last step.